简体版 繁體版 English
로그인 회원가입

strategy pattern 예문

예문모바일

  • The Strategy Pattern is used to accomplish this goal.
  • The strategy pattern uses composition instead of inheritance.
  • In the strategy pattern, behaviors are defined as separate interfaces and specific classes that implement these interfaces.
  • It has been described as a compile-time variant of the strategy pattern, and has connections with C + + template metaprogramming.
  • For instance, a class that performs validation on incoming data may use a strategy pattern to select a validation algorithm based on the type of data, the source of the data, user choice, or other discriminating factors.